62 WDT_A_hold(WDT_A_BASE);
66 GPIO_setAsPeripheralModuleFunctionInputPin(
71 UCS_turnOnLFXT1 (UCS_XT1_DRIVE_3,
76 PMM_setVCore (PMMCOREV_1);
79 UCS_initFLLSettle(12000,
83 Timer_D_initHighResGeneratorInRegulatedModeParam
param = {0};
84 param.clockSource = TIMER_D_CLOCKSOURCE_SMCLK;
85 param.clockSourceDivider = TIMER_D_CLOCKSOURCE_DIVIDER_1;
86 param.clockingMode = TIMER_D_CLOCKINGMODE_HIRES_LOCAL_CLOCK;
87 param.highResClockMultiplyFactor = TIMER_D_CLOCKSOURCE_DIVIDER_1;
88 param.highResClockDivider = TIMER_D_HIGHRES_CLK_MULTIPLY_FACTOR_16x;
89 Timer_D_initHighResGeneratorInRegulatedMode(TIMER_D0_BASE, &
param);
91 Timer_D_enableHighResInterrupt(TIMER_D0_BASE,
92 TIMER_D_HIGH_RES_FREQUENCY_LOCK
99 Timer_D_initCompareModeParam initComp0Param = {0};
100 initComp0Param.compareRegister = TIMER_D_CAPTURECOMPARE_REGISTER_0;
101 initComp0Param.compareInterruptEnable = TIMER_D_CAPTURECOMPARE_INTERRUPT_DISABLE;
102 initComp0Param.compareOutputMode = TIMER_D_OUTPUTMODE_TOGGLE;
103 initComp0Param.compareValue = 128-1;
104 Timer_D_initCompareMode(TIMER_D0_BASE, &initComp0Param);
106 Timer_D_initCompareModeParam initComp1Param = {0};
107 initComp1Param.compareRegister = TIMER_D_CAPTURECOMPARE_REGISTER_1;
108 initComp1Param.compareInterruptEnable = TIMER_D_CAPTURECOMPARE_INTERRUPT_DISABLE;
109 initComp1Param.compareOutputMode = TIMER_D_OUTPUTMODE_TOGGLE_SET;
110 initComp1Param.compareValue = 32;
111 Timer_D_initCompareMode(TIMER_D0_BASE, &initComp1Param);
113 Timer_D_initCompareModeParam initComp2Param = {0};
114 initComp2Param.compareRegister = TIMER_D_CAPTURECOMPARE_REGISTER_2;
115 initComp2Param.compareInterruptEnable = TIMER_D_CAPTURECOMPARE_INTERRUPT_DISABLE;
116 initComp2Param.compareOutputMode = TIMER_D_OUTPUTMODE_TOGGLE_SET;
117 initComp2Param.compareValue = 96;
118 Timer_D_initCompareMode(TIMER_D0_BASE, &initComp2Param);
120 Timer_D_initUpModeParam initUpParam = {0};
121 initUpParam.clockSource = TIMER_D_CLOCKSOURCE_SMCLK;
122 initUpParam.clockSourceDivider = TIMER_D_CLOCKSOURCE_DIVIDER_1;
123 initUpParam.clockingMode = TIMER_D_CLOCKINGMODE_HIRES_LOCAL_CLOCK;
124 initUpParam.timerPeriod = 128-1;
125 initUpParam.timerInterruptEnable_TDIE = TIMER_D_TDIE_INTERRUPT_DISABLE;
126 initUpParam.captureCompareInterruptEnable_CCR0_CCIE =
127 TIMER_D_CAPTURECOMPARE_INTERRUPT_DISABLE;
128 initUpParam.timerClear = TIMER_D_DO_CLEAR;
129 Timer_D_initUpMode(TIMER_D0_BASE, &initUpParam);
131 Timer_D_startCounter(TIMER_D0_BASE,
135 __bis_SR_register(LPM0_bits + GIE);
140 #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
141 #pragma vector=TIMER0_D1_VECTOR
143 #elif defined(__GNUC__)
144 __attribute__((interrupt(TIMER0_D1_VECTOR)))
148 switch(__even_in_range(TD0IV,30))
169 GPIO_setAsPeripheralModuleFunctionOutputPin(
171 GPIO_PIN6 + GPIO_PIN7
174 GPIO_setAsPeripheralModuleFunctionOutputPin(
MPU_initThreeSegmentsParam param